<?php
/*
Template Name:产品详情页模板
*/

get_header();

?>
<div class="container article-area">
    <div class="row">
        <h1 class="text-center aritcle-title">
            <?php the_title(); ?>
        </h1>

    </div>

    <div class="row">

        <div class="article-meta">

            <span class="userinfo"><i class="icofont icofont-user"></i>&nbsp;
                <?php  echo get_the_author_meta( 'display_name', $post->post_author ); ?>
            </span>
            <span class="date"><i class="icofont icofont-time"></i>&nbsp;
                <?php the_time('Y-m-d'); ?>
            </span>
            <span class="views">&nbsp;&nbsp;&nbsp;&nbsp;浏览量：
                <!-- <i class="icofont icofont-fire"></i> -->
                <?php setPostViews(get_the_ID()); echo number_format(getPostViews(get_the_ID())); ?>
            </span>


        </div>

    </div>
    <div class="row breadcrumbs">
        <?php	wheatv_breadcrumbs();?>
    </div>
    <div class="row product_canshu">
        <div class="col-lg-5 col-md-5 col-sm-12 col-12 ">
            <div class="product-img"><img src="<?php the_post_thumbnail_url( 'full' ); ?>" alt=""></div>
        </div>
        <div class="col-none col-lg-1 col-md-1 "></div>
        <div class="col-lg-6 col-md-6 col-sm-12 col-12 product-des">
            <h1 class="product-title"><?php the_title(); ?></h1>
            
                <?php
                   echo the_field('canshu');
                ?>

        </div>
    </div>

    <div class="row">
        <div class="col-lg-9 col-md-9 col-sm-12 col-12 ">
            
            <div class="product-des">


            </div>
            <div class="singledes">
                <div class="singledes-content">
                    <?php if (has_excerpt()) {
                        echo $description = trim(get_the_excerpt()); //文章编辑中的摘要
                    }else {
                        $article_des=mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 170,"……");
                        $str = mb_ereg_replace('^(　| )+', '', $article_des);
                        $str = mb_ereg_replace('(　| )+$', '', $str);
                        echo $str ; //文章编辑中若无摘要，自定截取文章内容字数做为摘要
                    } ?>
                </div>
            </div>


            <article class="article-content" id="article-content">

                <?php the_content(''); ?>

            </article>
            <div class="article-tag">
                <span class=""><i class="icofont icofont-tags"></i>
                    <?php the_tags('', ' ', ''); ?>
            </div>
            <div class="page">
                <div class="pre">
                    <?php previous_post_link('  上一篇：   %link'); ?>
                </div>
                <div class="next">
                    <?php next_post_link('  下一篇：  %link '); ?>
                </div>


            </div>
        </div>
        <aside class="col-none col-lg-3 col-md-3  sidebar sidebar-left">
            <div id="sidebar">
                <div class="widget">
                    <?php include_once("sidebar.php"); ?>
                </div>
            </div>
        </aside>
    </div>
</div>
<?php 
get_footer();